﻿ 
using SHKF.B2C.Model.Entity.Center;
using SqlSugar; 

namespace SHKF.B2C.BLL.Center
{
    public class VersionBLL : CenterBLL
    {
        public VersionBLL(SqlSugarClient db ) : base(db)
        {

        }

        public VersionEntity Query(long SN)
        {
            VersionEntity version = new VersionEntity();

            return version;
        }

        /// <summary>
        /// 获取最新版本信息
        /// </summary>
        /// <returns></returns>
        public VersionEntity QueryCurrent(int clientType)
        {
            VersionEntity version = this.db
                .Queryable<VersionEntity>()
                .Where(oo=>oo.ClientType == clientType)
                .OrderBy("SN")
                .First(); 

            return version;
        }

        //public List<VersionInfoEntity> QueryVersion( int clientType, string lastVersion)
        //{
        //    List < VersionInfoEntity >  list = this.db
        //        .Queryable<VersionInfoEntity>()
        //        .InnerJoin("Sys_Version b on b.fksn = a.sn and a.version = @Version and a.ClientType= @ClientType", 
        //                new { ClientType = clientType,  Version = lastVersion })
        //        .ToList();

        //    return list;
        //}
    }

   
}
